package com.kizuki.controller;

import com.kizuki.mapper.UserMapper;
import com.kizuki.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class MyRestController {

    // 应该要先调用service层的 这里偷懒
    @Autowired
    private UserMapper userMapper;

    @GetMapping("/users")
    public List<User> testIndex() {
        return userMapper.queryAllUser();
    }

}
